package com.myblog.expection;

import com.myblog.domain.entity.enums.GlobalResponseEnum;



public class GlobalException extends RuntimeException{

    private final int code;

    private final String msg;

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public GlobalException(GlobalResponseEnum globalResponseEnum) {
        super(globalResponseEnum.getMsg());
        this.code = globalResponseEnum.getCode();
        this.msg = globalResponseEnum.getMsg();
    }

    public GlobalException(Integer code,String msg) {
        this.code =code;
        this.msg =msg;
    }


}
